// custom-tab-bar/index.js
Component({

  /**
   * 组件的属性列表
   */
  properties: {

  },

  /**
   * 组件的初始数据
   */
  data: {
    active:0,
      "list": [{
        "pagePath": "/pages/home/home",
        "text": "主页",
        "msg":0,
        "icon":"home-o"
      },{
        "pagePath": "/pages/message/message",
        "text": "消息",
        "msg":9,
        "icon":"friends-o"
      },{
        "pagePath": "/pages/contact/contact",
        "text": "我的",
        "msg":0,
        "icon":"setting-o"
      }
    ]
  },

  /**
   * 组件的方法列表
   */
  methods: {
    onChange(event) {
      var path= this.data.list[event.detail].pagePath;
     // console.log(path);
      wx.switchTab({
        url: path
      })
      this.setData({ active: event.detail });
    }
  }
})